package com.yuanheng100.ems4j.common.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by wangguangshuo on 2016/12/16.
 */
public enum DepartmentType
{

    COMPANY((short) 1, "公司"),
    NORMAL((short) 2, "普通部门"),
    CHILDCOMPANY((short) 3, "分公司"),
    STORE((short) 4, "门店");

    private Short code;
    private String name;

    private static Map<Short, DepartmentType> typeMap = new HashMap<Short, DepartmentType>();

    static
    {
        for (DepartmentType type : DepartmentType.values())
        {
            typeMap.put(type.code, type);
        }
    }

    private DepartmentType(Short code, String name)
    {
        this.code = code;
        this.name = name;
    }

    public Short getCode()
    {
        return code;
    }

    public String getName()
    {
        return name;
    }

    public static Map<Short, DepartmentType> getTypeMap()
    {
        return typeMap;
    }
}
